package com.blvtphan.tipocketclubs.database;

public class DatabaseDefinition {
	public static final String CREATE_SQL = "createTable";
	public static final String UPDATE_SQL = "updateTable";

	public static final int DATABASE_VERSION = 1;
	public static final String DATABASE_NAME = "mobileconsignment.db";

	private final static String CREATE_TABLE = "CREATE TABLE ";
	private final static String T_LONG = " LONG ";
	private final static String T_DOUBLE = " DOUBLE ";
	private final static String T_INTEGER = " INTEGER ";

	private final static String T_TEXT = " TEXT ";
	private final static String T_PRIMARY_KEY = " PRIMARY KEY  ";
	private final static String T_PRIMARY_KEY_AUTOINCREMENT = " PRIMARY KEY AUTOINCREMENT ";

	/** tables in database */
	public static final Class<?>[] Tables = { MyAccount.class };

	public static final class MyAccount {
		public static final String TABLE = "tbl_myaccount";
		public static final String COLUMN_MY_ACCOUNT_ID = "c_myaccount_id";
		public static final String COLUMN_MY_ACCOUNT_FIRST_NAME = "c_myaccount_first_name";
		public static final String COLUMN_MY_ACCOUNT_LAST_NAME = "c_myaccount_last_name";
		public static final String COLUMN_MY_ACCOUNT_PHONE = "c_myaccount_phone";
		public static final String COLUMN_MY_ACCOUNT_EMAIL = "c_myaccount_email";
		public static final String COLUMN_MY_ACCOUNT_IMAGE = "c_myaccount_image";
		public static final String COLUMN_MY_ACCOUNT_USER_NAME = "c_myaccount_username";
		public static final String COLUMN_MY_ACCOUNT_PASSWORD = "c_myaccount_password";
		public static final String COLUMN_MY_ACCOUNT_TEAM_ID = "c_myaccount_team_id";

		/**
		 * build a sql string to create table my account
		 */
		public static String createTable() {
			return CREATE_TABLE + TABLE + " (" + COLUMN_MY_ACCOUNT_ID + T_LONG
					+ T_PRIMARY_KEY + "," + COLUMN_MY_ACCOUNT_FIRST_NAME
					+ T_TEXT + "," + COLUMN_MY_ACCOUNT_LAST_NAME + T_TEXT + ","
					+ COLUMN_MY_ACCOUNT_PHONE + T_TEXT + ","
					+ COLUMN_MY_ACCOUNT_EMAIL + T_TEXT + ","
					+ COLUMN_MY_ACCOUNT_IMAGE + T_TEXT + ","
					+ COLUMN_MY_ACCOUNT_USER_NAME + T_TEXT + ","
					+ COLUMN_MY_ACCOUNT_PASSWORD + T_TEXT + ","
					+ COLUMN_MY_ACCOUNT_TEAM_ID + T_INTEGER + ");";
		}

		/**
		 * build a sql string to update table my account
		 */
		public static String updateTable() {
			return "DROP TABLE IF EXISTS " + TABLE;
		}

	}

}
